const TYPING_BOOSTER_ENGINE = 'typing-booster';
+const FALLBACK_ENGINE_ID = 'xkb:us::eng';
+
function _checkIBusVersion(requiredMajor, requiredMinor, requiredMicro) {
if ((IBus.MAJOR_VERSION > requiredMajor) ||
(IBus.MAJOR_VERSION === requiredMajor && IBus.MINOR_VERSION > requiredMinor) ||
this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
this._cancellable);
} catch (e) {
- logErrorUnlessCancelled(e);
+ if (!logErrorUnlessCancelled(e))
+ return;
+
+ try {
+ await this._ibus.set_global_engine_async(FALLBACK_ENGINE_ID,
+ this._MAX_INPUT_SOURCE_ACTIVATION_TIME,
+ this._cancellable);
+ } catch (e2) {
+ logErrorUnlessCancelled(e2);
+ }
}
}
KeyboardManager.holdKeyboard();
this._keyboardManager.apply(is.xkbId);
- // All the "xkb:..." IBus engines simply "echo" back symbols,
- // despite their naming implying differently, so we always set
- // one in order for XIM applications to work given that we set
- // XMODIFIERS=@im=ibus in the first place so that they can
- // work without restarting when/if the user adds an IBus input
- // source.
let engine;
- if (is.type === INPUT_SOURCE_TYPE_IBUS)
+ if (is.type === INPUT_SOURCE_TYPE_IBUS) {
engine = is.id;
- else
- engine = 'xkb:us::eng';
+ } else {
+ const [name, variant = ''] = is.id.split('+');
+ const [lang = 'eng'] = this._xkbInfo.get_languages_for_layout(is.id);
+ engine = `xkb:${name}:${variant}:${lang}`;
+ }
this._ibusManager.setEngine(engine).then(() => {
if (holdKeyboard)